package com.ruoyi.job.actuator.impl;

import com.ruoyi.job.domain.SysJobVo;
import com.ruoyi.job.util.AbstractQuartzJob;
import com.ruoyi.job.util.CommandUtil;
import com.ruoyi.job.util.ScheduleUtils;
import com.ruoyi.job.vo.CommandResult;
import com.ruoyi.job.vo.TaskParam;
import org.quartz.JobExecutionContext;

/**
 * Shell执行器
 *
 * @author liangli_lmj@126.com
 * @date 2024-11-28
 */
public class PythonExecution extends AbstractQuartzJob {

    @Override
    protected CommandResult doExecute(JobExecutionContext context, SysJobVo sysJobVo, TaskParam taskParam) throws Exception {
        String[] strArray = ScheduleUtils.commandParams(taskParam);

        return CommandUtil.exec("python", taskParam.getName(), strArray);
    }
}
